package com.wendyxie.sproutup.entity

import com.wendyxie.sproutup.enum.ScoreStatusEnum
import java.time.LocalDateTime

data class UserScoreRecordEntity(
    var id: String? = null, // 主键ID
    var userId: String = "", // 用户ID
    var babyId: String = "", // 宝宝编号
    var score: Int, // 用户得分
    var totalScoreStart: Int, // 总得分（不包含本次得分）
    var totalScoreEnd: Int, // 总得分（包含本次得分）
    var scoreTitle: String? = null, // 得分原因
    var scoreTmplId: String? = null, // 关联的模板ID
    var scoreStatus: ScoreStatusEnum? = null, // 得分状态：CREATE-创建，COLLECT-已归集，DELETE-已删除
    var scoreTime: LocalDateTime, // 得分时间，默认为当前时间
    var pageSize: Int = 10,
    var page: Int = 1
) {
    /**
     * 查询参数：默认无内容
     */
    constructor() : this(
        null,
        "",
        "",
        0,
        0,
        0,
        null,
        null,
        null,
        LocalDateTime.now(),
        10,
        1
    )

    /**
     * 新增记录
     */
    constructor(userId: String, babyId: String, score: Int, scoreTitle: String, scoreTmplId: String) : this(
        null,
        "",
        "",
        score,
        0,
        0,
        scoreTitle,
        scoreTmplId,
        ScoreStatusEnum.CREATE,
        LocalDateTime.now(),
        10,
        1

    )

    /**
     * 查询请求参数：分页、状态
     */
    constructor(StatusEnum: ScoreStatusEnum, page: Int = 0, pageSize: Int = 10) : this(
        null,
        "",
        "",
        0,
        0,
        0,
        null,
        null,
        StatusEnum,
        LocalDateTime.now(),
        pageSize,
        page
    )

    /**
     * 查询请求参数-分页
     */
    constructor(page: Int = 0, pageSize: Int = 10) : this(
        null,
        "",
        "",
        0,
        0,
        0,
        null,
        null,
        null,
        LocalDateTime.now(),
        pageSize,
        page
    )
}
